package top.toptimus.dto.stock.purchase;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.constValue.StockType;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PurchaseOrderEntryDTO {
    private String entryId; //  采购分录ID
    private String materialId;    //  物料id
    private String materialCode;    //  物料编码
    private double quantity;    //  数量
    private double purchasePrice;   //  采购单价
    private double stockInUnitPrice;   //  入库加权平均价格

    public String buildInsertSQL() {
        return "insert into t_inventory_log(fabric,quantity,inout_type,create_date,code,price) \n" +
                "values ( '" + this.materialId + "','" + this.quantity + "','" + StockType.PURCHASE_STOCK_IN + "',now(),'" + this.materialCode + "','" + this.stockInUnitPrice + "');";
    }

}
